<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>i-SNS Server</title>
</head>
<body>
<h2>HOST=http://isns1.s42.eatj.com</h2>
<table bgcolor="#DDDDDD" border="1">
	<thead>
		<tr>
			<h3>Interfaces Declaration</h3>
		</tr>
	</thead>
	<tbody>
		<tr style="color: White; background-color: Navy" align="center">
			<td>Interface</td>
			<td>Description</td>
			<td>Parameters</td>
			<td>Returned</td>
			<td>URL</td>
		</tr>
		<tr>
			<td>NewQuestion</td>
			<td>Raise a question.</td>
			<td>
			<li>[uName:String]</li>
			<i>Display name of question owner.</i>
			<li>[qBody:String]</li>
			<i>Content of question.</i>
			<li>[qType:String]</li>
			<i>Type of question. </i>
			<li>[qPos:String]</li>
			<i>Location of owner when raising a question.</i> {<b>FORMAT="<b>locationName:longitude,latitude</b>"</b>}</td>
			<td><b>JSON Object</b></br>
			{"result":"$qId"}</br>
			-1 if failed insert question.</td>
			<td>$HOST$/NewQuestion?uName&qBody&qType&qPos</td>
		</tr>
		<tr>
			<td>AnswerQuestion</td>
			<td>Answer a question.</td>
			<td>
			<li>[qId:String]</li>
			<i>Identify of question.</i>
			<li>[uName:String]</li>
			<i>Display name of answer owner.</i>
			<li>[aBody:String]</li>
			<i>Content of answer.</i>
			<li>[aPos:String]</li>
			<i>Location of owner when answering a question.</i> {<b>FORMAT="locationName:longitude,latitude"</b>}</td>
			<td><b>JSON Object</b></br>
			{"result":"$aId"}</br>
			-1 if failed insert question.</td>
			<td>$HOST$/AnswerQuestion?qId&uName&aBody&aPos</td>
		</tr>
		<tr>
			<td>ListQuestions</td>
			<td>Query all questions whose raised </br>
			time is after the specific qDate.</td>
			<td>
			<li>[qDate:String]</li>
			<i>The specific date.</i>{<b>FORMAT="yyyy-MM-dd HH:mm:ss"</b>}</td>
			<td><b>JSON Array</b></br>
			Example: [{</br>
			"body":"who are you?",</br>
			"datetime":"2011-06-08 23:12:16",</br>
			"id":42,</br>
			"owner":{"currentLocation":0,"id":10,"name":"fancy"},</br>
			"triggerLocation":</br>
			{"id":21,"latitude":"30.20","longitude":"200.11","name":null},</br>
			"type":0</br>
			}]</td>
			<td>$HOST$/ListQuestions?qDate</td>
		</tr>
		<tr>
			<td>ListAnswsers</td>
			<td>Query all answer of one question.</td>
			<td>
			<li>[qId:String]</li>
			<i>Identify of question.</i></td>
			<td><b>JSON Array</b></br>
			Example: [{</br>
			"body":"i'm lucy",</br>
			"datetime":"2011-06-08 23:19:54",</br>
			"id":1,</br>
			"owner":{"currentLocation":0,"id":11,"name":"lucy"},</br>
			"question":{"body":"","datetime":"","id":42,"owner":{"currentLocation":0,"id":-1,"name":""},
			"triggerLocation":{"id":-1,"latitude":"","longitude":"","name":""},"type":0},</br>
			"triggerLocation":{"id":22,"latitude":"230.22","longitude":"10.22","name":null}</br>
			}]</td>
			<td>$HOST$/ListAnswsers?qId</td>
		</tr>
	</tbody>
</table>

</body>
</html>